<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>考核申请</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/iconfont.css">
    <link rel="stylesheet" href="../lib/layui/css/layui.css" media="all">

    <link rel="stylesheet" href="../css/xadmin.css">
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <script src="../js/base.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        tr td,
        tr th {
            text-align: center !important;
            border: none !important;
        }

        .layui-laydate-content tr td {
            border-bottom: none !important;
            border-top: none !important;
        }

        tr td {
            border-bottom: 1px solid #eee !important;
            border-top: 1px solid #eee !important;
        }

        .shaixuan .layui-col-md12 .layui-inline {
            margin: 0;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md3 .layui-form-label {
            width: 30%;
            padding-left: 0;
        }

        .shaixuan .layui-col-md12 .layui-inline.layui-col-md3 .layui-input-inline {
            width: 53%;
        }

        .rotate {

            transform-origin: center center;

            transform: rotate(180deg);

            -webkit-transform: rotate(180deg);

            -moz-transform: rotate(180deg);

            -ms-transform: rotate(180deg);

            -o-transform: rotate(180deg);

            transition: transform 0.2s;
            -moz-transition: -moz-transform 0.2s;

            -moz-transition: -moz-transform 0.2s;

            -o-transition: -o-transform 0.2s;

            -ms-transition: -ms-transform 0.2s;

        }

        .rotate1 {

            transform-origin: center center;

            transform: rotate(0deg);
            -webkit-transform: rotate(0deg);

            -moz-transform: rotate(deg);

            -ms-transform: rotate(0deg);

            -o-transform: rotate(0deg);

            transition: transform 0.2s;

            -moz-transition: -moz-transform 0.2s;

            -moz-transition: -moz-transform 0.2s;

            -o-transition: -o-transform 0.2s;

            -ms-transition: -ms-transform 0.2s;

        }
    </style>
</head>

<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card" style="display: flex;justify-content: space-between;">
                <div class="layui-card-body ">
                    <blockquote class="layui-elem-quote" style="border:0;font-size: 18px;color: #000;">裁判员列表
                    </blockquote>
                </div>
            </div>
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                <!-- <div class="layui-card-header">数据统计</div> -->
                <div class="layui-fluid">
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md12">
                            <div class="layui-card-body " style="display: flex;justify-content:space-between">
                                <form class="layui-form" action="" style="width: 100%;">
                                    <div class="layui-inline layui-show-xs-block">
                                        <input id="name" autocomplete="off" class="layui-input" type="text" placeholder="请输入教练员姓名">
                                    </div>
                                    <div class="layui-inline layui-show-xs-block">
                                        <button class="layui-btn search" data-type="reload" lay-filter="add">搜索
                                        </button>
                                        <i style="position: relative;font-size: 18px;left: 15px;top: 5px;cursor: pointer;display: inline-block;"
                                           class="layui-icon layui-icon-down rotate1"></i>
                                    </div>
                                    <div class="layui-inline layui-show-xs-block" style="float: right">
                                        <blockquote style="cursor: pointer" class="layui-elem-quote"
                                                    onclick="xadmin.open('导入','referee_import_pro.html',600,400)"><i
                                                class="iconfont">&#xe635;</i>导入
                                        </blockquote>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-md12 shaixuan" style="display: none;">
            <div class="layui-card">
                <!-- <div class="layui-card-header">数据统计</div> -->
                <div class="layui-fluid">
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md12">
                            <div class="layui-card-body " style="display: flex;justify-content:space-between">
                                <form class="layui-form" action="" style="width: 100%;">
                                    <div class="layui-form-item layui-col-md12">
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">年份：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="year" id="year" lay-verify="year"
                                                       autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">裁判员等级：</label>
                                            <div class="layui-input-inline">
                                                <select id="refereeLevel" name="refereeLevel" lay-verify="required">
                                                    <option value="">全部</option>
                                                    <option value="5">国际级裁判</option>
                                                    <option value="4">国家级</option>
                                                    <option value="3">国家一级</option>
                                                    <option value="2">国家二级</option>
                                                    <option value="1">国家三级</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">性别：</label>
                                            <div class="layui-input-inline">
                                                <select id="sex" name="sex" lay-verify="required">
                                                    <option value="">全部</option>
                                                    <option value="1">男</option>
                                                    <option value="2">女</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">证件类型：</label>
                                            <div class="layui-input-inline">
                                                <select id="documentType" name="documentType" lay-verify="required">
                                                    <option value="">全部</option>
                                                    <option value="1">身份证</option>
                                                    <option value="2">护照</option>
                                                    <option value="3">户口本</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">身高：</label>
                                            <div class="layui-input-inline">
                                                <input id="height" type="text" name="height" lay-verify="required"
                                                       autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">体重：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" id="weight" name="weight" lay-verify="required"
                                                       autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">血型：</label>
                                            <div class="layui-input-inline">
                                                <select id="bloodType" name="bloodType" lay-verify="required">
                                                    <option value="">全部</option>
                                                    <option value="1">A</option>
                                                    <option value="2">B</option>
                                                    <option value="3">AB</option>
                                                    <option value="4">O</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">市级：</label>
                                            <div class="layui-input-inline">
                                                <select id="city" name="city" lay-verify="required">
                                                    <option value="">全部</option>

                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">民族：</label>
                                            <div class="layui-input-inline">
                                                <select id="nation" name="nation" lay-verify="required" lay-search>
                                                    <option value="">请选择</option>
                                                    <option value="汉族">汉族</option>
                                                    <option value="阿昌族">阿昌族</option>
                                                    <option value="白族">白族</option>
                                                    <option value="保安族">保安族</option>
                                                    <option value="布朗族">布朗族</option>
                                                    <option value="布依族">布依族</option>
                                                    <option value="朝鲜族">朝鲜族</option>
                                                    <option value="达斡尔族">达斡尔族</option>
                                                    <option value="傣族">傣族</option>
                                                    <option value="德昂族">德昂族</option>
                                                    <option value="侗族">侗族</option>
                                                    <option value="东乡族">东乡族</option>
                                                    <option value="独龙族">独龙族</option>
                                                    <option value="鄂伦春族">鄂伦春族</option>
                                                    <option value="俄罗斯族">俄罗斯族</option>
                                                    <option value="鄂温克族">鄂温克族</option>
                                                    <option value="高山族">高山族</option>
                                                    <option value="仡佬族">仡佬族</option>
                                                    <option value="哈尼族">哈尼族</option>
                                                    <option value="哈萨克族">哈萨克族</option>
                                                    <option value="赫哲族">赫哲族</option>
                                                    <option value="回族">回族</option>
                                                    <option value="基诺族">基诺族</option>
                                                    <option value="京族">京族</option>
                                                    <option value="景颇族">景颇族</option>
                                                    <option value="柯尔克孜族">柯尔克孜族</option>
                                                    <option value="拉祜族">拉祜族</option>
                                                    <option value="黎族">黎族</option>
                                                    <option value="傈僳族">傈僳族</option>
                                                    <option value="珞巴族">珞巴族</option>
                                                    <option value="满族">满族</option>
                                                    <option value="毛南族">毛南族</option>
                                                    <option value="门巴族">门巴族</option>
                                                    <option value="蒙古族">蒙古族</option>
                                                    <option value="苗族">苗族</option>
                                                    <option value="仫佬族">仫佬族</option>
                                                    <option value="纳西族">纳西族</option>
                                                    <option value="怒族">怒族</option>
                                                    <option value="普米族">普米族</option>
                                                    <option value="羌族">羌族</option>
                                                    <option value="撒拉族">撒拉族</option>
                                                    <option value="畲族">畲族</option>
                                                    <option value="水族">水族</option>
                                                    <option value="塔吉克族">塔吉克族</option>
                                                    <option value="塔塔尔族">塔塔尔族</option>
                                                    <option value="土族">土族</option>
                                                    <option value="土家族">土家族</option>
                                                    <option value="佤族">佤族</option>
                                                    <option value="锡伯族">锡伯族</option>
                                                    <option value="乌兹别克族">乌兹别克族</option>
                                                    <option value="瑶族">瑶族</option>
                                                    <option value="彝族">彝族</option>
                                                    <option value="裕固族">裕固族</option>
                                                    <option value="维吾尔族">维吾尔族</option>
                                                    <option value="壮族">壮族</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">出生日期：</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="birthDay" id="birthDay" lay-verify="date"
                                                       autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">政治面貌：</label>
                                            <div class="layui-input-inline">
                                                <select id="politicCountenance" name="politicCountenance"
                                                        lay-verify="required">
                                                    <option value="">全部</option>
                                                    <option value="1">党员</option>
                                                    <option value="2">共青团员</option>
                                                    <option value="3">群众</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">裁判服尺码：</label>
                                            <div class="layui-input-inline">
                                                <select id="refereeClothingSize" name="refereeClothingSize"
                                                        lay-verify="required">
                                                    <option value="">全部</option>
                                                    <option value="1">S</option>
                                                    <option value="2">M</option>
                                                    <option value="3">L</option>
                                                    <option value="4">XL</option>
                                                    <option value="5">XXL</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">其他服装尺码：</label>
                                            <div class="layui-input-inline">
                                                <select id="otherClothingSize" name="otherClothingSize"
                                                        lay-verify="required">
                                                    <option value="">全部</option>
                                                    <option value="1">S</option>
                                                    <option value="2">M</option>
                                                    <option value="3">L</option>
                                                    <option value="4">XL</option>
                                                    <option value="5">XXL</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">足球鞋尺码：</label>
                                            <div class="layui-input-inline">
                                                <input id="soccerShoesSize" type="text" name="soccerShoesSize"
                                                       lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-inline layui-col-md3">
                                            <label class="layui-form-label">跑步鞋尺码：</label>
                                            <div class="layui-input-inline">
                                                <input id="runningShoesSize" type="text" name="runningShoesSize"
                                                       lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-card-body layui-table-body layui-table-main">

            <!-- 表格部分开始 -->
            <table id="application_table" lay-filter="test" lay-data="{id: 'testReload'}"></table>
            <script type="text/html" id="barDemo">
                <!--<a lay-event="detail" class="btn_a layui-btn layui-btn-primary layui-btn-xs">查看</a>-->
                <a lay-event="watch" class="btn_a layui-btn layui-btn-xs">查看</a>
                <a lay-event="edit" class="btn_a layui-btn layui-btn-xs">修改</a>
                <a lay-event="del" class="btn_a layui-btn layui-btn-danger layui-btn-xs">锁定</a>
            </script>
            <!-- 表格结束 -->
        </div>
    </div>
</div>
</div>
</body>

</html>

<script>
    layui.use(['table', 'laydate'], function () {
        var table = layui.table;
        var form = layui.form;
        var laydate = layui.laydate;

        var cityList = ["济南市", "青岛市", "聊城市", "德州市", "东营市", "淄博市", "潍坊市", "烟台市", "威海市", "日照市", "临沂市", "枣庄市",
            "济宁市", "泰安市", "滨州市", "菏泽市"
        ]
        for (var i = 0; i < cityList.length; i++) {
            $("#city").append(
                "<option value=\"" + cityList[i] + "\">" + cityList[i] + "</option>"
            )
        }

        var index = layer.load(1); //添加laoding,0-2两种方式

        laydate.render({ // 初始化时间选择器
            elem: '#year',
            type: 'year'
        });
        laydate.render({ // 初始化时间选择器
            elem: '#birthDay',
        });


        //第一个实例


        table.render({
            title: "裁判员列表",
            elem: '#application_table', //指定原始表格元素选择器（推荐id选择器）
            // height: 600,
            toolbar: true,
            defaultToolbar: ['exports', {
                title: '提示' //标题
                ,
                layEvent: 'LAYTABLE_TIPS' //事件名，用于 toolbar 事件中使用
                ,
                icon: 'layui-icon-tips' //图标类名
            }],
            width: "100%",
            // 附加参数，post token
            // where: { 'token': token },
            loading: true,
            method: 'get',
            url: getJudgeList, //数据接口
            page: true, //开启分页
            // toolbar: 'default', //开启工具栏，此处显示默认图标
            limit: 10,
            limits: [10, 20, 30, 50, 100, 500, 1000, 5000, 10000],
            cols: [
                [ //表头
                    // {
                    //     type: 'checkbox',
                    //     fixed: 'left'
                    // },
                    {
                        field: 'id',
                        title: '用户ID',
                        width: 70
                    },
                    {
                        field: 'headPhoto',
                        title: '头像',
                        width: 150,
                        templet: function (d) {
                            if (d.headPhoto == null || d.headPhoto == "") {
                                return "-"
                            } else {
                                return "<div onclick='show_img(this)' ><img style='width: 32px;height: 32px;' src='" +
                                    d.headPhoto + "'></div>'"
                            }
                        }
                    },
                    {
                        field: 'name',
                        title: '姓名',
                        width: 70
                    },
                    {
                        field: 'sex',
                        title: '性别',
                        width: 70,
                        templet: function (d) {
                            if (d.sex == "1") {
                                return "男"
                            } else if (d.sex == "2") {
                                return "女"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        field: 'bloodType',
                        title: '血型',
                        width: 70,
                        templet: function (d) {
                            if (d.bloodType == "1") {
                                return "A"
                            } else if (d.bloodType == "2") {
                                return "B"
                            } else if (d.bloodType == "3") {
                                return "AB"
                            } else if (d.bloodType == "4") {
                                return "O"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        field: 'refereeLevel',
                        title: '裁判员等级',
                        width: 150,
                        templet: function (d) {
                            if (d.refereeLevel == "1") {
                                return "国家三级"
                            } else if (d.refereeLevel == "2") {
                                return "国家二级"
                            } else if (d.refereeLevel == "3") {
                                return "国家一级"
                            } else if (d.refereeLevel == "4") {
                                return "国家级"
                            } else if (d.refereeLevel == "5") {
                                return "国际级裁判"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        field: 'nation',
                        title: '民族',
                        width: 70
                    },
                    {
                        field: 'year',
                        title: '年份',
                        width: 70
                    },
                    {
                        field: 'city',
                        title: '市级',
                        width: 70
                    },
                    {
                        field: 'documentType',
                        title: '证件类型',
                        width: 150,
                        templet: function (d) {
                            if (d.documentType == "1") {
                                return "身份证"
                            } else if (d.documentType == "2") {
                                return "护照"
                            } else if (d.documentType == "3") {
                                return "户口本"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        field: 'documentNumber',
                        title: '证件号码',
                        width: 200,
                        templet: function (d) {
                            return d.documentNumber + "&nbsp;"
                        }
                    },
                    {
                        field: 'height',
                        title: '身高',
                        width: 70
                    },
                    {
                        field: 'weight',
                        title: '体重',
                        width: 70
                    },
                    {
                        field: 'nationality',
                        title: '国籍',
                        width: 70
                    },
                    {
                        field: 'birthAddress',
                        title: '出生地',
                        width: 70
                    },
                    {
                        field: 'birthDay',
                        title: '出生日期',
                        width: 150
                    },
                    {
                        field: 'politicCountenance',
                        title: '政治面貌',
                        width: 150,
                        templet: function (d) {
                            if (d.politicCountenance == "1") {
                                return "党员"
                            } else if (d.politicCountenance == "2") {
                                return "团员"
                            } else if (d.politicCountenance == "3") {
                                return "群众"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        field: 'email',
                        title: '电子邮箱',
                        width: 150
                    },
                    {
                        field: 'tel',
                        title: '手机号',
                        width: 150
                    },
                    {
                        field: 'otherTel',
                        title: '其他电话',
                        width: 150
                    },
                    {
                        field: 'graduateSchool',
                        title: '毕业院校',
                        width: 150
                    },
                    {
                        field: 'major',
                        title: '主修专业',
                        width: 150
                    },
                    {
                        field: 'heightEducation',
                        title: '最高学历',
                        width: 150
                    },
                    {
                        field: 'englishLevel',
                        title: '英语水平',
                        width: 150,
                        templet: function (d) {
                            if (d.englishLevel == "1") {
                                return "2级"
                            } else if (d.englishLevel == "2") {
                                return "3级"
                            } else if (d.englishLevel == "3") {
                                return "4级"
                            } else if (d.englishLevel == "4") {
                                return "8级"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        field: 'workUnit',
                        title: '单位',
                        width: 150
                    },
                    {
                        field: 'job',
                        title: '职务',
                        width: 150
                    },
                    {
                        field: 'address',
                        title: '邮寄地址',
                        width: 150
                    },
                    {
                        field: 'refereeClothingSize',
                        title: '裁判服尺码',
                        width: 150,
                        templet: function (d) {
                            if (d.refereeClothingSize == "1") {
                                return "S"
                            } else if (d.refereeClothingSize == "2") {
                                return "M"
                            } else if (d.refereeClothingSize == "3") {
                                return "L"
                            } else if (d.refereeClothingSize == "4") {
                                return "XL"
                            } else if (d.refereeClothingSize == "5") {
                                return "XXL"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        field: 'otherClothingSize',
                        title: '其他服装尺码',
                        width: 150,
                        templet: function (d) {
                            if (d.otherClothingSize == "1") {
                                return "S"
                            } else if (d.otherClothingSize == "2") {
                                return "M"
                            } else if (d.otherClothingSize == "3") {
                                return "L"
                            } else if (d.otherClothingSize == "4") {
                                return "XL"
                            } else if (d.otherClothingSize == "5") {
                                return "XXL"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        field: 'soccerShoesSize',
                        title: '足球鞋尺码',
                        width: 150
                    },
                    {
                        field: 'runningShoesSize',
                        title: '跑步鞋尺码',
                        width: 150
                    },
                    {
                        field: 'medicalReportUrl',
                        title: '体检报告',
                        width: 150,
                        templet: function (d) {
                            if (d.medicalReportUrl == null || d.medicalReportUrl == "") {
                                return "-"
                            } else {
                                return "<div onclick='show_img(this)' ><img style='width: 32px;height: 32px;' src='" +
                                    d.medicalReportUrl + "'></div>'"
                            }
                        }
                    },
                    {
                        field: 'medicalReportDate',
                        title: '体检时间',
                        width: 150
                    },
                    {
                        field: 'addTime',
                        title: '创建时间',
                        width: 150,
                        templet: function (d) {
                            if (d.addTime == null) {
                                return "-"
                            } else {
                                return d.addTime
                            }
                        }
                    },
                    {
                        field: 'ishidden',
                        title: '是否锁定',
                        width: 150,
                        templet: function (d) {
                            if (d.ishidden == "0") {
                                return "正常"
                            } else if (d.bloodType == "1") {
                                return "锁定"
                            } else {
                                return ""
                            }
                        }
                    },
                    {
                        fixed: 'right',
                        title: "操作",
                        width: 250,
                        align: 'center',
                        toolbar: '#barDemo'
                    }
                ]
            ],
            id: 'testReload',
            done: function (res) {
                if (res.msg == "2") {
                    parent.window.location.href = getRequestPrefix() + "/footBallAdmin/login.html"
                }
                layer.close(index)
            }
        });

        // table.on('checkbox(test)', function (obj) {
        //     console.log(obj)
        // });
        var checkStatus = table.checkStatus('testReload'); //idTest 即为基础参数 id 对应的值
        $("span").on("click", function () {
            checkStatus
            console.log(checkStatus) //获取选中行数量，可作为是否有选中行的条件
            console.log(checkStatus.isAll) //表格是否全选
        })

        //下拉框
        $(".layui-icon.layui-icon-down").on("click", function () {
            $(".shaixuan").stop(true, false);
            if ($(this).hasClass("rotate") && !$(this).hasClass("rotate1")) {
                $(this).removeClass("rotate").addClass("rotate1");
                $(".shaixuan").slideUp()
            } else if ($(this).hasClass("rotate1") && !$(this).hasClass("rotate")) {
                $(this).removeClass("rotate1").addClass("rotate");
                $(".shaixuan").slideDown()
            }
        })
        //头部输入框筛选功能
        var active = {

            reload: function () {
                var name = $('#name');
                var year = $('#year');
                var sex = $('#sex');
                var documentType = $('#documentType');
                var height = $('#height');
                var weight = $('#weight');
                var city = $('#city');
                var nation = $('#nation');
                var birthDay = $('#birthDay');
                var politicCountenance = $('#politicCountenance');
                var refereeClothingSize = $('#refereeClothingSize');
                var otherClothingSize = $('#otherClothingSize');
                var soccerShoesSize = $('#soccerShoesSize');
                var runningShoesSize = $('#runningShoesSize');
                var refereeLevel = $('#refereeLevel');

                // 执行重载（重新加载数据表格）
                table.reload('testReload', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    },
                    where: {
                        name: name.val(),
                        year: year.val(),
                        sex: sex.val(),
                        documentType: documentType.val(),
                        height: height.val(),
                        weight: weight.val(),
                        city: city.val(),
                        nation: nation.val(),
                        birthDay: birthDay.val(),
                        politicCountenance: politicCountenance.val(),
                        refereeClothingSize: refereeClothingSize.val(),
                        otherClothingSize: otherClothingSize.val(),
                        soccerShoesSize: soccerShoesSize.val(),
                        runningShoesSize: runningShoesSize.val(),
                        refereeLevel: refereeLevel.val()
                    }
                }, 'data');
            }
        };


        //给查询添加点击事件
        $('.search').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
            //一定要阻止表单的默认行为（刷新）
            return false
        });


        //监听点击的按钮，获取行信息
        table.on('tool(test)', function (obj) { //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
            //获得当前行数据
            var $ = layui.$
            var data = obj.data,
                layEvent = obj.event; //获得 lay-event 对应的值

            if (layEvent === "edit") {
                // layer.msg('审批');
                layer.open({
                    content: "edit_judge_info.html",
                    type: 2, //打开的窗口的类型
                    area: ["100%", "100%"],
                    title: "修改信息",
                    // btn: ['确认', '取消'],//开启显示按钮功能
                    // btnAlign: 'c',//居中显示按钮
                    // shade:true,
                    shadeClose: true,
                    success: function (layero, index) {

                        // console.log(data)//获取点击行的数据,获取打开的iframe
                        var body = layer.getChildFrame('body', index);
                        var iframeWin = window[layero.find('iframe')[0]['name']];
                        body.find(".selected input").eq(data.role - 1).attr("checked",
                            'checked');
                        body.find("#name").val(data.name);
                        body.find("#name").attr("data-id", data.id);
                        body.find("#sex").val(data.sex);
                        body.find("#documentType").val(data.documentType);
                        body.find("#documentNumber").val(data.documentNumber);
                        body.find("#height").val(data.height);
                        body.find("#weight").val(data.weight);
                        body.find("#bloodType").val(data.bloodType);
                        body.find("#nationality").val(data.nationality);
                        body.find("#nation").val(data.nation);
                        body.find("#year").val(data.year);
                        body.find("#birthDay").val(data.birthDay);
                        body.find("#birthAddress").val(data.birthAddress);
                        body.find("#politicCountenance").val(data.politicCountenance);
                        body.find("#refereeLevel").val(data.refereeLevel);
                        body.find("#tel").val(data.tel);
                        body.find("#otherTel").val(data.otherTel);
                        body.find("#email").val(data.email);
                        body.find("#graduateSchool").val(data.graduateSchool);
                        body.find("#major").val(data.major);
                        body.find("#heightEducation").val(data.heightEducation);
                        body.find("#englishLevel").val(data.englishLevel);
                        body.find("#workUnit").val(data.workUnit);
                        body.find("#job").val(data.job);
                        body.find("#address").val(data.address);
                        body.find("#refereeClothingSize").val(data.refereeClothingSize);
                        body.find("#otherClothingSize").val(data.otherClothingSize);
                        body.find("#soccerShoesSize").val(data.soccerShoesSize);
                        body.find("#runningShoesSize").val(data.runningShoesSize);
                        body.find("#medicalReportDate").val(data.medicalReportDate);
                        if (data.bankList.length > 0) {
                            if (data.bankList[0].bankCardNumA) {
                                body.find("#bankCardNumA").val(data.bankList[0]
                                    .bankCardNumA);
                                body.find("#openingBankA").val(data.bankList[0]
                                    .openingBankA);
                            }
                            if (data.bankList[0].bankCardNumB) {
                                body.find("#bankCardNumB").val(data.bankList[0]
                                    .bankCardNumB);
                                body.find("#openingBankB").val(data.bankList[0]
                                    .openingBankB);
                            }
                            if (data.bankList[0].bankCardNumC) {
                                body.find("#bankCardNumC").val(data.bankList[0]
                                    .bankCardNumC);
                                body.find("#openingBankC").val(data.bankList[0]
                                    .openingBankC);
                            }
                        }
                        body.find("#city").attr("data-val", data.city);
                        body.find("#updateTijian").attr("src", data.medicalReportUrl);
                        body.find("#updateHeadImg").attr("src", data.headPhoto);
                        iframeWin.frames.layui.form.render("select");
                        iframeWin.frames.layui.form.render("radio")
                        // body.find('#refereeClothingSize').text(data.refereeClothingSize);
                        // body.find('#otherClothingSize').text(data.otherClothingSize);
                        // body.find('#soccerShoesSize').text(data.soccerShoesSize);
                        // body.find('#runningShoesSize').text(data.runningShoesSize);
                    }
                })
            }
            if (layEvent === "watch") {
                // layer.msg('审批');
                layer.open({
                    content: "look_judge_info.html",
                    type: 2, //打开的窗口的类型
                    area: ["100%", "100%"],
                    title: "查看信息",
                    // btn: ['确认', '取消'],//开启显示按钮功能
                    // btnAlign: 'c',//居中显示按钮
                    // shade:true,
                    shadeClose: true,
                    success: function (layero, index) {

                        // console.log(data)//获取点击行的数据,获取打开的iframe
                        var body = layer.getChildFrame('body', index);
                        var iframeWin = window[layero.find('iframe')[0]['name']];
                        console.log(data)
                        if (data.role == "1") {
                            body.find('#juese').text("男子裁判员");
                        } else if (data.role == "2") {
                            body.find('#juese').text("女子裁判员");
                        } else if (data.role == "3") {
                            body.find('#juese').text("五人制/沙足裁判员");
                        } else if (data.role == "4") {
                            body.find('#juese').text("男足裁判监督");
                        } else if (data.role == "5") {
                            body.find('#juese').text("五人制裁判监督");
                        } else if (data.role == "6") {
                            body.find('#juese').text("裁判技术讲师");
                        } else if (data.role == "7") {
                            body.find('#juese').text("裁判体能讲师");
                        } else if (data.role == "8") {
                            body.find('#juese').text("女足裁判监督");
                        }
                        if (data.bloodType == "1") {
                            body.find('#bloodType').text("A");
                        } else if (data.bloodType == "2") {
                            body.find('#bloodType').text("B");
                        } else if (data.bloodType == "3") {
                            body.find('#bloodType').text("AB");
                        } else if (data.bloodType == "4") {
                            body.find('#bloodType').text("O");
                        }
                        if (data.documentType == "1") {
                            body.find('#documentType').text("身份证");
                        } else if (data.documentType == "2") {
                            body.find('#documentType').text("护照");
                        } else if (data.documentType == "3") {
                            body.find('#documentType').text("户口本");
                        }
                        if (data.sex == "1") {
                            body.find('#sex').text("男");
                        } else if (data.sex == "2") {
                            body.find('#sex').text("女");
                        }
                        if (data.politicCountenance == "1") {
                            body.find('#politicCountenance').text("党员");
                        } else if (data.politicCountenance == "2") {
                            body.find('#politicCountenance').text("共青团员");
                        } else if (data.politicCountenance == "3") {
                            body.find('#politicCountenance').text("群众");
                        }
                        if (data.refereeLevel == "1") {
                            body.find('#refereeLevel').text("国家三级");
                        } else if (data.refereeLevel == "2") {
                            body.find('#refereeLevel').text("国家二级");
                        } else if (data.refereeLevel == "3") {
                            body.find('#refereeLevel').text("国家一级");
                        } else if (data.refereeLevel == "4") {
                            body.find('#refereeLevel').text("国家级");
                        } else if (data.refereeLevel == "5") {
                            body.find('#refereeLevel').text("国际级裁判");
                        }
                        body.find('#id').text(data.id);
                        body.find("#name").text(data.name);
                        body.find("#documentNumber").text(data.documentNumber);
                        body.find("#height").text(data.height);
                        body.find("#weight").text(data.weight);
                        body.find("#nationality").text(data.nationality);
                        body.find("#nation").text(data.nation);
                        body.find("#year").text(data.year);
                        body.find("#birthDay").text(data.birthDay);
                        body.find("#birthAddress").text(data.birthAddress);
                        body.find("#tel").text(data.tel);
                        body.find("#otherTel").text(data.otherTel);
                        body.find("#email").text(data.email);
                        body.find("#graduateSchool").text(data.graduateSchool);
                        body.find("#major").text(data.major);
                        body.find("#heightEducation").text(data.heightEducation);
                        if (data.englishLevel == "1") {
                            body.find("#englishLevel").text("2级");
                        } else if (data.englishLevel == "2") {
                            body.find("#englishLevel").text("3级");
                        } else if (data.englishLevel == "3") {
                            body.find("#englishLevel").text("4级");
                        } else if (data.englishLevel == "4") {
                            body.find("#englishLevel").text("8级");
                        }
                        body.find("#workUnit").text(data.workUnit);
                        body.find("#job").text(data.job);
                        body.find("#address").text(data.address);
                        if (data.refereeClothingSize == "1") {
                            body.find("#refereeClothingSize").text("S");
                        } else if (data.refereeClothingSize == "2") {
                            body.find("#refereeClothingSize").text("M");
                        } else if (data.refereeClothingSize == "3") {
                            body.find("#refereeClothingSize").text("L");
                        } else if (data.refereeClothingSize == "4") {
                            body.find("#refereeClothingSize").text("XL");
                        } else if (data.refereeClothingSize == "5") {
                            body.find("#refereeClothingSize").text("XXL");
                        }
                        if (data.otherClothingSize == "1") {
                            body.find("#otherClothingSize").text("S");
                        } else if (data.otherClothingSize == "2") {
                            body.find("#otherClothingSize").text("M");
                        } else if (data.otherClothingSize == "3") {
                            body.find("#otherClothingSize").text("L");
                        } else if (data.otherClothingSize == "4") {
                            body.find("#otherClothingSize").text("XL");
                        } else if (data.otherClothingSize == "5") {
                            body.find("#otherClothingSize").text("XXL");
                        }
                        body.find("#soccerShoesSize").text(data.soccerShoesSize);
                        body.find("#runningShoesSize").text(data.runningShoesSize);
                        body.find("#medicalReportDate").text(data.medicalReportDate);
                        if (data.bankList.length > 0) {
                            if (data.bankList[0].bankCardNumA) {
                                body.find("#bankCardNumA").text(data.bankList[0]
                                    .bankCardNumA);
                                body.find("#openingBankA").text(data.bankList[0]
                                    .openingBankA);
                            }
                            if (data.bankList[0].bankCardNumB) {
                                body.find("#bankCardNumB").text(data.bankList[0]
                                    .bankCardNumB);
                                body.find("#openingBankB").text(data.bankList[0]
                                    .openingBankB);
                            }
                            if (data.bankList[0].bankCardNumC) {
                                body.find("#bankCardNumC").text(data.bankList[0]
                                    .bankCardNumC);
                                body.find("#openingBankC").text(data.bankList[0]
                                    .openingBankC);
                            }
                        }
                        body.find("#city").text(data.city);
                        body.find("#medicalReportUrl").attr("src", data.medicalReportUrl);
                        body.find("#headPhoto").attr("src", data.headPhoto);
                        // body.find('#refereeClothingSize').text(data.refereeClothingSize);
                        // body.find('#otherClothingSize').text(data.otherClothingSize);
                        // body.find('#soccerShoesSize').text(data.soccerShoesSize);
                        // body.find('#runningShoesSize').text(data.runningShoesSize);
                    }
                })
            }
            ;
            if (layEvent === 'del') {

                layer.confirm('确认锁定？', function (index) {
                    layer.close(index);

                    $.ajax({ //保存表单
                        url: delJudgeList,
                        type: "POST",
                        // 设置的是请求参数
                        data: {
                            id: data.id
                        },
                        // 用于设置响应体的类型 注意 跟 data 参数没关系！！！
                        dataType: 'json',
                        success: function (res) {
                            if (res.msg !== "0") {
                                layer.alert(res.msg, {
                                    title: "提示"
                                });
                            } else {
                                layer.alert("操作成功", {
                                    title: "提示",
                                    cancel: function (index) {
                                        layer.close(index);
                                        obj.del();
                                    }
                                }, function (index) {
                                    layer.close(index);
                                    obj.del();
                                });
                            }
                        }
                    })

                });
            }
        });


    });

    function show_img(t) { //放大图片
        var t = $(t).find("img");
        //页面层
        layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['300px', '343px'], //宽高
            shadeClose: true, //开启遮罩关闭
            end: function (index, layero) {
                return false;
            },
            content: '<div style="text-align:center;width:100%;height: 100%;overflow: hidden"><img src="' + $(t)
                .attr('src') + '" style="width:100%;height: 100%;display: block;margin: 0 auto;"/></div>'
        });
    }
</script>